#include<bits/stdc++.h>
using namespace std;
#define lowbit(x) ((x)&(-(x)))
const int N=1e6+10,INF=1e6+10;
int n,a[N],ans;
deque<int> b1,b2;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;++i) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n;++i){
        int pos=INF;
        if(!b2.empty()) pos=b2.front();
        if(a[i]>pos){
            b2.pop_front();
            b2.push_back(a[i]);
        }
        else{
            if(!b1.empty()) pos=b1.front();
            if(a[i]>pos){
                b1.pop_front();
                b2.push_back(a[i]);
            }
            else{
                b1.push_back(a[i]);
            }
        }
    }
    ans=b1.size()+b2.size();
    cout<<ans<<'\n';
    return 0;
}
//Never Forget freopen("xx.in","r",stdin); !!!!!!
//freopen!!!!!!
//Be attetion to the data range and Long Long !!!
//Force Solution must be started in 30 minutes!!!
/*
10
136 136 136 2417 136 136 2417 136 136 136
*/
